<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>员工修改信息审核</title>
	<link rel="stylesheet" href="/Public/User/pc/css/bootstrap.min.css">
	<script src="/Public/User/pc/js/jquery-1.8.3.min.js"></script>
	<style>
		.container {
			padding-left: 10%;
			margin-right: auto;
			margin-left: auto;
		}

		.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
			padding: 8px;
			line-height: 1.42857143;
			vertical-align: top;
			border-top: 0px solid #ddd;

		}


	</style>
</head>
<body>

<nav class="navbar navbar-default ">
	<div class="container">
		<div class="btn-group" role="group" >
			<?php if(array_key_exists('insert',$list)){ $insert_display='style="display:block"'; }else{ $insert_display='style="display:none"'; } ?>
			<button type="button" id="btn1" <?php echo $insert_display;?> class="btn btn-success">新增的数据</button>

			<?php if(array_key_exists('update',$list)){ $update_display='style="display:block"'; }else{ $update_display='style="display:none"'; } ?>
			<button type="button" id="btn2" <?php echo $update_display;?>  class="btn btn-info">更改的数据</button>
			<?php if(array_key_exists('delete',$list)){ $delete_display='style="display:block"'; }else{ $delete_display='style="display:none"'; } ?>
			<button type="button" id="btn3" <?php echo $delete_display;?>  class="btn bbtn-danger">删除的数据</button>
		</div>
	</div>
</nav>

<?php foreach($list['insert'] as $k=>$v){?>
<form class="form-horizontal container"  id="form1">
	<?php foreach($v as $k1=>$v1){ ?>
	<div class="form-group">
		<label  class="col-sm-2 control-label"><?php echo $v1['caption'];?>:</label>
		<div class="col-sm-6">
			<input type="text" class="form-control" value="<?php echo $v1['value'];?>" placeholder="请输入姓名">
		</div>
	</div>
	<?php } ?>
</form>
<?php } ?>

<?php foreach($list['update'] as $k=>$v){?>
<form class="form-horizontal container" id="form2">
	<table class="table"  >
        <?php foreach($v as $k1=>$v1){?>
		<tr>
			<td >
				<div class="form-group">
					<label  class="col-sm-3 control-label"><?php echo $v1['caption'];?>新值:</label>
					<div class="col-sm-9">
						<input type="text" class="form-control" value="<?php echo $v1['value']; ?>" >
					</div>
				</div>
			</td>
            <td >
                <div class="form-group">
                    <label  class="col-sm-3 control-label"><?php echo $v1['caption'];?>原值:</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" value="<?php echo $v1['oldvalue']; ?>"  >
                    </div>
                </div>
            </td>
		</tr>
        <?php } ?>
	</table>
</form>
<?php } ?>

<?php foreach($list['delete'] as $k=>$v){?>
<form class="form-horizontal container" id="form3">
    <?php foreach($v as $k1=>$v1){ ?>
    <div class="form-group">
        <label  class="col-sm-2 control-label"><?php echo $v1['caption'];?>:</label>
        <div class="col-sm-6">
            <input type="text" class="form-control" value="<?php echo $v1['value'];?>" placeholder="请输入姓名">
        </div>
    </div>
    <?php } ?>
</form>
<?php } ?>

</body>
<script>
	$(function(){
		$('#form2').hide();
		$('#form3').hide();
        var btn1 = $('#btn1').css('display');
        var btn2 = $('#btn2').css('display');
        var btn3 = $('#btn3').css('display');
        if(btn1 == 'none'){
            $('#form2').show();
        }else if(btn2 == 'none'){
            $('#form3').show();
        }

		$('#btn1').click(function(){
			$('#form1').show();
			$('#form2').hide();
			$('#form3').hide();
		});

		$('#btn2').click(function(){
			$('#form1').hide();
			$('#form2').show();
			$('#form3').hide();
		});

		$('#btn3').click(function(){
			$('#form1').hide();
			$('#form2').hide();
			$('#form3').show();
		});
	})
</script>
</html>